package com.citicpub_cloud.restfull.server;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice;

import com.citicpub_cloud.restfull.common.cache.RedisDao;
import com.citicpub_cloud.restfull.utils.AppConfigProp;

/**
 * server 基类
 *
 */
public abstract class BaseServer {

    protected Logger log = LoggerFactory.getLogger(this.getClass());

    @Autowired
    protected AppConfigProp appConfigProp;

    @Autowired
    protected RedisDao redisDao;
   

    public BaseServer(){
       
    }

    @ControllerAdvice
    static class JsonpAdvice extends AbstractJsonpResponseBodyAdvice {
        public JsonpAdvice() {
            super("callback");
        }
    }

    protected Integer getSessionTimeout(){
        return appConfigProp.getSessionTimeout();
    }

}
